class Solution {
public:
    double average(vector<int>& salary) {
        int s = reduce(salary.begin(), salary.end());
        auto [m, M] = ranges::minmax(salary);
        return (double)(s - m - M) / (salary.size() - 2);
    }
};
